﻿    <?php $this->load->view('user/user_head');?>
    <script src="<?php echo base_url()?>/js/page/jquery.pagination.js" type="text/javascript"></script>
    <link href="<?php echo base_url();?>js/page/pagination.css" rel="stylesheet" type="text/css"/>
    
    <script language="javascript">
	$(function(){
		$("table.datalist tr:nth-child(odd)").addClass("altrow");

		function pageselectCallback(page_index, jq){
     	   	var offset = page_index * 10;
      	    var url =  "<?php echo base_url();?>/index.php/user/guestAction/ajax_list";
    	    $.ajax({
    	      type: "POST",
    		  url: url,
    		  cache: false,
    		  data: {offset:offset},
    		  dataType : "html",
    		  success: function(html) {
    		    $("#guest_list").html(html);
    		  }
    		}); 
    	    return false;
    	}
    	
		var opt = {callback:pageselectCallback, items_per_page:10, num_display_entries:3, num_edge_entries:2, next_text:'下一页', prev_text:'上一页'};
	    $("#Pagination").pagination(<?php echo  isset($total_count) ? $total_count : 1;?>, opt);
	});
	</script>
    
    <input type="hidden" id="page_code" value="5"/>
    <!-- begin: main content area #main -->
     <div id="main">
      <!-- begin: #col1 - first float column -->
      <div id="col1" role="complementary">
         <?php $this->load->view('user/guest_left_nav.php')?>
      </div>
      <!-- end: #col1 -->
      <!-- begin: #col3 static column -->
      <div id="col3" role="main">
        <div id="col3_content" class="clearfix">
            <div class="sys_help_msg_box" style="height:100px;margin-bottom:10px;">
	        	<p style="margin:20px 10px 0 20px;"><strong style="color:#d02200">温馨提示:</strong>
	        	邀请来宾管理、可以提醒您及时联系各位来宾、确保亲朋好友参加您的婚宴！
				还可以通过此项功能、预测礼金哦、预算一下大家能够给你随多少银两；等婚礼结束后与礼金管理配合使用看看哪位仁兄尚未到场！此项功能
				还可以与婚礼预算配合使用，用于预算婚礼的收支平衡!
	        	</p>
            </div>
            <?php echo isset($msg) ? $msg : ""; ?>
            <?php if ($guest_list):?>
    

            <div id="guest_list">
           	<table class="datalist" summary="list of members in EE Studay" id="oTable">
				<tr>
					<th scope="col">选择</th>
					<th scope="col">姓名</th>
					<th scope="col">电话</th>
					<th scope="col">类型</th>
					<th scope="col">状态</th>
					<th scope="col" width="250px">备注</th>
				</tr>
	            <?php foreach ($guest_list as $v):?>
	            	
	            	<tr>
	            		<td><input type="checkbox"/></td>
	            		<td>
	            			<a href="del/<?php echo $v->id;?>"><img title="删除嘉宾"  alt="删除嘉宾" src="<?php echo base_url()?>images/icon/s_remove.png"/></a>
	            			<a href="<?php echo base_url()?>index.php/user/guestAction/edit_init/<?php echo $v->id;?>"><img title="编辑嘉宾" alt="编辑嘉宾" src="<?php echo base_url()?>images/icon/s_edit.png"/></a>
	            			<?php echo $v->i_name;?>
	            		</td>
	            		<td><?php echo $v->phone;?>&nbsp;</td>

	
	            		<?php if ($v->i_category == '1'):?>
	            		<td>新郎同学</td>
	            		<?php endif;?>
	            		
	            		<?php if ($v->i_category == '2'):?>
	            		<td>新郎朋友</td>
	            		<?php endif;?>
	            		
	            		<?php if ($v->i_category == '3'):?>
	            		<td>新郎同事</td>
	            		<?php endif;?>
	            		
	            		<?php if ($v->i_category == '4'):?>
	            		<td>新娘同学</td>
	            		<?php endif;?>
	            		
	            		<?php if ($v->i_category == '5'):?>
	            		<td>新娘朋友</td>
	            		<?php endif;?>
	            		
	            		<?php if ($v->i_category == '6'):?>
	            		<td>新娘同事</td>
	            		<?php endif;?>
	            		
	            		<?php if ($v->i_category == '7'):?>
	            		<td>娘家亲属</td>
	            		<?php endif;?>
	            		
	            		<?php if ($v->i_category == '8'):?>
	            		<td>娘家朋友</td>
	            		<?php endif;?>
	            		
	            		<?php if ($v->i_category == '9'):?>
	            		<td>娘家同事</td>
	            		<?php endif;?>
	            		
	            		<?php if ($v->i_category == '10'):?>
	            		<td>婆家亲属</td>
	            		<?php endif;?>
	            		
	            		<?php if ($v->i_category == '11'):?>
	            		<td>婆家朋友</td>
	            		<?php endif;?>
	            		
	            		<?php if ($v->i_category == '12'):?>
	            		<td>婆家同事</td>
	            		<?php endif;?>
	            		
	            		
	            		<?php if ($v->i_flag == '0'):?>
	            		<td>未邀请</td>
	            		<?php endif;?>
	            		<?php if ($v->i_flag == '1'):?>
	            		<td>已邀请</td>
	            		<?php endif;?>
	            		<td><?php echo $v->remark;?>&nbsp;</td>
	            	</tr>
	            <?php endforeach;?>
	        </table>
	        </div>
        	<div id="Pagination" class="pagination"></div>
	        <?php endif;?>
            <?php if (!$guest_list):?>
            	<div>你尚未邀请任何人参加您的婚礼 ~ <a href="edit_init">[赶快邀请哦]</a></div>
            <?php endif;?>
        </div>
        <div id="ie_clearing">&nbsp;</div>
        <!-- End: IE Column Clearing -->
      </div>
      <!-- end: #col3 -->
    </div>
    <!-- end: #main -->
<?php $this->load->view('user/footer');?>